using Godot;
using System;

public partial class P7信号 : Node2D
{
	//自定义信号
	Button mButton;
	NMyButton mMyButton;
	// Called when the node enters the scene tree for the first time.
	public override void _Ready()
	{
		mButton = GetNode<Button>("Button");
		mButton.Pressed += () => _on_button_pressed();

		mButton.Toggled += (b) => _tobble(1, 2);

		mMyButton = GetNodeOrNull<NMyButton>("NMyButton");
		mMyButton.AddMoney += (m) => _addMoney(m);
	}

	// Called every frame. 'delta' is the elapsed time since the previous frame.
	public override void _Process(double delta)
	{
	}

	void _addMoney(int money)
	{
		GD.Print(money);
	}

	void _on_button_pressed()
	{
		GD.Print("投币1000");
	}

	void _tobble(int p1, int p2)
	{

	}
}
